<?php
namespace app\index\controller;
use think\Controller;

class news extends Controller
{
    public function index(){
        $data = Db('news')->where(['headlines'=>1,'news_statuid'=>1])->select();
        $this->assign('data',$data);
        return $this->fetch();
    }

    /**
     * 新闻详情
     */
    public function news_info(){
        $id = session('user.id');
        if(empty($id)){
            // return view('index/login');
            // $index = controller('Index', 'controller');
            // return $index->login();
            return action('Index/login');
        }
        $id = input('param.id');
        $data = Db('news')->where(['id'=>$id])->find();
        $this->assign('data',$data);
        return view('listtail');
    }
}